3.249 \(\int \tan (c+d x) (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx\)

Optimal. Leaf size=165 \[ \frac{b \left (a^2 A-2 a b B-A b^2\right ) \tan (c+d x)}{d}-\frac{\left (a^3 A-3 a^2 b B-3 a A b^2+b^3 B\right ) \log (\cos (c+d x))}{d}-x \left (3 a^2 A b+a^3 B-3 a b^2 B-A b^3\right )+\frac{(a A-b B) (a+b \tan (c+d x))^2}{2 d}+\frac{A (a+b \tan (c+d x))^3}{3 d}+\frac{B (a+b \tan (c+d x))^4}{4 b d} \]

[Out]

-((3*a^2*A*b - A*b^3 + a^3*B - 3*a*b^2*B)*x) - ((a^3*A - 3*a*A*b^2 - 3*a^2*b*B + b^3*B)*Log[Cos[c + d*x]])/d +
 (b*(a^2*A - A*b^2 - 2*a*b*B)*Tan[c + d*x])/d + ((a*A - b*B)*(a + b*Tan[c + d*x])^2)/(2*d) + (A*(a + b*Tan[c +
 d*x])^3)/(3*d) + (B*(a + b*Tan[c + d*x])^4)/(4*b*d)

________________________________________________________________________________________

Rubi [A]  time = 0.193966, antiderivative size = 165, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.138, Rules used = {3592, 3528, 3525, 3475} \[ \frac{b \left (a^2 A-2 a b B-A b^2\right ) \tan (c+d x)}{d}-\frac{\left (a^3 A-3 a^2 b B-3 a A b^2+b^3 B\right ) \log (\cos (c+d x))}{d}-x \left (3 a^2 A b+a^3 B-3 a b^2 B-A b^3\right )+\frac{(a A-b B) (a+b \tan (c+d x))^2}{2 d}+\frac{A (a+b \tan (c+d x))^3}{3 d}+\frac{B (a+b \tan (c+d x))^4}{4 b d} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]*(a + b*Tan[c + d*x])^3*(A + B*Tan[c + d*x]),x]

[Out]

-((3*a^2*A*b - A*b^3 + a^3*B - 3*a*b^2*B)*x) - ((a^3*A - 3*a*A*b^2 - 3*a^2*b*B + b^3*B)*Log[Cos[c + d*x]])/d +
 (b*(a^2*A - A*b^2 - 2*a*b*B)*Tan[c + d*x])/d + ((a*A - b*B)*(a + b*Tan[c + d*x])^2)/(2*d) + (A*(a + b*Tan[c +
 d*x])^3)/(3*d) + (B*(a + b*Tan[c + d*x])^4)/(4*b*d)

Rule 3592

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(B*d*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Int[(a + b*Tan[e
 + f*x])^m*Simp[A*c - B*d + (B*c + A*d)*Tan[e + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b
*c - a*d, 0] &&  !LeQ[m, -1]

Rule 3528

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d
*(a + b*Tan[e + f*x])^m)/(f*m), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \tan (c+d x) (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx &=\frac{B (a+b \tan (c+d x))^4}{4 b d}+\int (-B+A \tan (c+d x)) (a+b \tan (c+d x))^3 \, dx\\ &=\frac{A (a+b \tan (c+d x))^3}{3 d}+\frac{B (a+b \tan (c+d x))^4}{4 b d}+\int (a+b \tan (c+d x))^2 (-A b-a B+(a A-b B) \tan (c+d x)) \, dx\\ &=\frac{(a A-b B) (a+b \tan (c+d x))^2}{2 d}+\frac{A (a+b \tan (c+d x))^3}{3 d}+\frac{B (a+b \tan (c+d x))^4}{4 b d}+\int (a+b \tan (c+d x)) \left (-2 a A b-a^2 B+b^2 B+\left (a^2 A-A b^2-2 a b B\right ) \tan (c+d x)\right ) \, dx\\ &=-\left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) x+\frac{b \left (a^2 A-A b^2-2 a b B\right ) \tan (c+d x)}{d}+\frac{(a A-b B) (a+b \tan (c+d x))^2}{2 d}+\frac{A (a+b \tan (c+d x))^3}{3 d}+\frac{B (a+b \tan (c+d x))^4}{4 b d}+\left (a^3 A-3 a A b^2-3 a^2 b B+b^3 B\right ) \int \tan (c+d x) \, dx\\ &=-\left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) x-\frac{\left (a^3 A-3 a A b^2-3 a^2 b B+b^3 B\right ) \log (\cos (c+d x))}{d}+\frac{b \left (a^2 A-A b^2-2 a b B\right ) \tan (c+d x)}{d}+\frac{(a A-b B) (a+b \tan (c+d x))^2}{2 d}+\frac{A (a+b \tan (c+d x))^3}{3 d}+\frac{B (a+b \tan (c+d x))^4}{4 b d}\\ \end{align*}

Mathematica [C]  time = 1.43618, size = 209, normalized size = 1.27 \[ \frac{-12 A b^2 \left (b^2-6 a^2\right ) \tan (c+d x)-6 (a A+b B) \left (6 a b^2 \tan (c+d x)+(-b+i a)^3 \log (-\tan (c+d x)+i)-(b+i a)^3 \log (\tan (c+d x)+i)+b^3 \tan ^2(c+d x)\right )+24 a A b^3 \tan ^2(c+d x)+6 i A (a-i b)^4 \log (\tan (c+d x)+i)-6 i A (a+i b)^4 \log (-\tan (c+d x)+i)+3 B (a+b \tan (c+d x))^4+4 A b^4 \tan ^3(c+d x)}{12 b d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]*(a + b*Tan[c + d*x])^3*(A + B*Tan[c + d*x]),x]

[Out]

((-6*I)*A*(a + I*b)^4*Log[I - Tan[c + d*x]] + (6*I)*A*(a - I*b)^4*Log[I + Tan[c + d*x]] - 12*A*b^2*(-6*a^2 + b
^2)*Tan[c + d*x] + 24*a*A*b^3*Tan[c + d*x]^2 + 4*A*b^4*Tan[c + d*x]^3 + 3*B*(a + b*Tan[c + d*x])^4 - 6*(a*A +
b*B)*((I*a - b)^3*Log[I - Tan[c + d*x]] - (I*a + b)^3*Log[I + Tan[c + d*x]] + 6*a*b^2*Tan[c + d*x] + b^3*Tan[c
 + d*x]^2))/(12*b*d)

________________________________________________________________________________________

Maple [A]  time = 0.011, size = 314, normalized size = 1.9 \begin{align*}{\frac{B{b}^{3} \left ( \tan \left ( dx+c \right ) \right ) ^{4}}{4\,d}}+{\frac{A \left ( \tan \left ( dx+c \right ) \right ) ^{3}{b}^{3}}{3\,d}}+{\frac{B \left ( \tan \left ( dx+c \right ) \right ) ^{3}a{b}^{2}}{d}}+{\frac{3\,A \left ( \tan \left ( dx+c \right ) \right ) ^{2}a{b}^{2}}{2\,d}}+{\frac{3\,B \left ( \tan \left ( dx+c \right ) \right ) ^{2}{a}^{2}b}{2\,d}}-{\frac{B{b}^{3} \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{2\,d}}+3\,{\frac{A\tan \left ( dx+c \right ){a}^{2}b}{d}}-{\frac{A{b}^{3}\tan \left ( dx+c \right ) }{d}}+{\frac{B{a}^{3}\tan \left ( dx+c \right ) }{d}}-3\,{\frac{Ba{b}^{2}\tan \left ( dx+c \right ) }{d}}+{\frac{A{a}^{3}\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) }{2\,d}}-{\frac{3\,\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) Aa{b}^{2}}{2\,d}}-{\frac{3\,\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) B{a}^{2}b}{2\,d}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) B{b}^{3}}{2\,d}}-3\,{\frac{A\arctan \left ( \tan \left ( dx+c \right ) \right ){a}^{2}b}{d}}+{\frac{A\arctan \left ( \tan \left ( dx+c \right ) \right ){b}^{3}}{d}}-{\frac{B{a}^{3}\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}}+3\,{\frac{B\arctan \left ( \tan \left ( dx+c \right ) \right ) a{b}^{2}}{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)*(a+b*tan(d*x+c))^3*(A+B*tan(d*x+c)),x)

[Out]

1/4/d*B*b^3*tan(d*x+c)^4+1/3/d*A*tan(d*x+c)^3*b^3+1/d*B*tan(d*x+c)^3*a*b^2+3/2/d*A*tan(d*x+c)^2*a*b^2+3/2/d*B*
tan(d*x+c)^2*a^2*b-1/2/d*B*b^3*tan(d*x+c)^2+3/d*A*tan(d*x+c)*a^2*b-1/d*A*b^3*tan(d*x+c)+1/d*a^3*B*tan(d*x+c)-3
/d*B*a*b^2*tan(d*x+c)+1/2/d*a^3*A*ln(1+tan(d*x+c)^2)-3/2/d*ln(1+tan(d*x+c)^2)*A*a*b^2-3/2/d*ln(1+tan(d*x+c)^2)
*B*a^2*b+1/2/d*ln(1+tan(d*x+c)^2)*B*b^3-3/d*A*arctan(tan(d*x+c))*a^2*b+1/d*A*arctan(tan(d*x+c))*b^3-1/d*a^3*B*
arctan(tan(d*x+c))+3/d*B*arctan(tan(d*x+c))*a*b^2

________________________________________________________________________________________

Maxima [A]  time = 1.45606, size = 242, normalized size = 1.47 \begin{align*} \frac{3 \, B b^{3} \tan \left (d x + c\right )^{4} + 4 \,{\left (3 \, B a b^{2} + A b^{3}\right )} \tan \left (d x + c\right )^{3} + 6 \,{\left (3 \, B a^{2} b + 3 \, A a b^{2} - B b^{3}\right )} \tan \left (d x + c\right )^{2} - 12 \,{\left (B a^{3} + 3 \, A a^{2} b - 3 \, B a b^{2} - A b^{3}\right )}{\left (d x + c\right )} + 6 \,{\left (A a^{3} - 3 \, B a^{2} b - 3 \, A a b^{2} + B b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 12 \,{\left (B a^{3} + 3 \, A a^{2} b - 3 \, B a b^{2} - A b^{3}\right )} \tan \left (d x + c\right )}{12 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))^3*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/12*(3*B*b^3*tan(d*x + c)^4 + 4*(3*B*a*b^2 + A*b^3)*tan(d*x + c)^3 + 6*(3*B*a^2*b + 3*A*a*b^2 - B*b^3)*tan(d*
x + c)^2 - 12*(B*a^3 + 3*A*a^2*b - 3*B*a*b^2 - A*b^3)*(d*x + c) + 6*(A*a^3 - 3*B*a^2*b - 3*A*a*b^2 + B*b^3)*lo
g(tan(d*x + c)^2 + 1) + 12*(B*a^3 + 3*A*a^2*b - 3*B*a*b^2 - A*b^3)*tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 1.94001, size = 408, normalized size = 2.47 \begin{align*} \frac{3 \, B b^{3} \tan \left (d x + c\right )^{4} + 4 \,{\left (3 \, B a b^{2} + A b^{3}\right )} \tan \left (d x + c\right )^{3} - 12 \,{\left (B a^{3} + 3 \, A a^{2} b - 3 \, B a b^{2} - A b^{3}\right )} d x + 6 \,{\left (3 \, B a^{2} b + 3 \, A a b^{2} - B b^{3}\right )} \tan \left (d x + c\right )^{2} - 6 \,{\left (A a^{3} - 3 \, B a^{2} b - 3 \, A a b^{2} + B b^{3}\right )} \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 12 \,{\left (B a^{3} + 3 \, A a^{2} b - 3 \, B a b^{2} - A b^{3}\right )} \tan \left (d x + c\right )}{12 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))^3*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/12*(3*B*b^3*tan(d*x + c)^4 + 4*(3*B*a*b^2 + A*b^3)*tan(d*x + c)^3 - 12*(B*a^3 + 3*A*a^2*b - 3*B*a*b^2 - A*b^
3)*d*x + 6*(3*B*a^2*b + 3*A*a*b^2 - B*b^3)*tan(d*x + c)^2 - 6*(A*a^3 - 3*B*a^2*b - 3*A*a*b^2 + B*b^3)*log(1/(t
an(d*x + c)^2 + 1)) + 12*(B*a^3 + 3*A*a^2*b - 3*B*a*b^2 - A*b^3)*tan(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 0.819067, size = 311, normalized size = 1.88 \begin{align*} \begin{cases} \frac{A a^{3} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - 3 A a^{2} b x + \frac{3 A a^{2} b \tan{\left (c + d x \right )}}{d} - \frac{3 A a b^{2} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{3 A a b^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} + A b^{3} x + \frac{A b^{3} \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac{A b^{3} \tan{\left (c + d x \right )}}{d} - B a^{3} x + \frac{B a^{3} \tan{\left (c + d x \right )}}{d} - \frac{3 B a^{2} b \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{3 B a^{2} b \tan ^{2}{\left (c + d x \right )}}{2 d} + 3 B a b^{2} x + \frac{B a b^{2} \tan ^{3}{\left (c + d x \right )}}{d} - \frac{3 B a b^{2} \tan{\left (c + d x \right )}}{d} + \frac{B b^{3} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{B b^{3} \tan ^{4}{\left (c + d x \right )}}{4 d} - \frac{B b^{3} \tan ^{2}{\left (c + d x \right )}}{2 d} & \text{for}\: d \neq 0 \\x \left (A + B \tan{\left (c \right )}\right ) \left (a + b \tan{\left (c \right )}\right )^{3} \tan{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))**3*(A+B*tan(d*x+c)),x)

[Out]

Piecewise((A*a**3*log(tan(c + d*x)**2 + 1)/(2*d) - 3*A*a**2*b*x + 3*A*a**2*b*tan(c + d*x)/d - 3*A*a*b**2*log(t
an(c + d*x)**2 + 1)/(2*d) + 3*A*a*b**2*tan(c + d*x)**2/(2*d) + A*b**3*x + A*b**3*tan(c + d*x)**3/(3*d) - A*b**
3*tan(c + d*x)/d - B*a**3*x + B*a**3*tan(c + d*x)/d - 3*B*a**2*b*log(tan(c + d*x)**2 + 1)/(2*d) + 3*B*a**2*b*t
an(c + d*x)**2/(2*d) + 3*B*a*b**2*x + B*a*b**2*tan(c + d*x)**3/d - 3*B*a*b**2*tan(c + d*x)/d + B*b**3*log(tan(
c + d*x)**2 + 1)/(2*d) + B*b**3*tan(c + d*x)**4/(4*d) - B*b**3*tan(c + d*x)**2/(2*d), Ne(d, 0)), (x*(A + B*tan
(c))*(a + b*tan(c))**3*tan(c), True))

________________________________________________________________________________________

Giac [B]  time = 5.83873, size = 3875, normalized size = 23.48 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))^3*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/12*(12*B*a^3*d*x*tan(d*x)^4*tan(c)^4 + 36*A*a^2*b*d*x*tan(d*x)^4*tan(c)^4 - 36*B*a*b^2*d*x*tan(d*x)^4*tan(c
)^4 - 12*A*b^3*d*x*tan(d*x)^4*tan(c)^4 + 6*A*a^3*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(
c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^4 - 18*B*a^2*b*log(4*(tan(c)
^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)
)*tan(d*x)^4*tan(c)^4 - 18*A*a*b^2*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^
2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^4 + 6*B*b^3*log(4*(tan(c)^2 + 1)/(tan(d*x)
^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(
c)^4 - 48*B*a^3*d*x*tan(d*x)^3*tan(c)^3 - 144*A*a^2*b*d*x*tan(d*x)^3*tan(c)^3 + 144*B*a*b^2*d*x*tan(d*x)^3*tan
(c)^3 + 48*A*b^3*d*x*tan(d*x)^3*tan(c)^3 - 18*B*a^2*b*tan(d*x)^4*tan(c)^4 - 18*A*a*b^2*tan(d*x)^4*tan(c)^4 + 9
*B*b^3*tan(d*x)^4*tan(c)^4 - 24*A*a^3*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*
x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^3*tan(c)^3 + 72*B*a^2*b*log(4*(tan(c)^2 + 1)/(ta
n(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^
3*tan(c)^3 + 72*A*a*b^2*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2
+ tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^3*tan(c)^3 - 24*B*b^3*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^
2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^3*tan(c)^3 + 12*
B*a^3*tan(d*x)^4*tan(c)^3 + 36*A*a^2*b*tan(d*x)^4*tan(c)^3 - 36*B*a*b^2*tan(d*x)^4*tan(c)^3 - 12*A*b^3*tan(d*x
)^4*tan(c)^3 + 12*B*a^3*tan(d*x)^3*tan(c)^4 + 36*A*a^2*b*tan(d*x)^3*tan(c)^4 - 36*B*a*b^2*tan(d*x)^3*tan(c)^4
- 12*A*b^3*tan(d*x)^3*tan(c)^4 + 72*B*a^3*d*x*tan(d*x)^2*tan(c)^2 + 216*A*a^2*b*d*x*tan(d*x)^2*tan(c)^2 - 216*
B*a*b^2*d*x*tan(d*x)^2*tan(c)^2 - 72*A*b^3*d*x*tan(d*x)^2*tan(c)^2 - 18*B*a^2*b*tan(d*x)^4*tan(c)^2 - 18*A*a*b
^2*tan(d*x)^4*tan(c)^2 + 6*B*b^3*tan(d*x)^4*tan(c)^2 + 36*B*a^2*b*tan(d*x)^3*tan(c)^3 + 36*A*a*b^2*tan(d*x)^3*
tan(c)^3 - 24*B*b^3*tan(d*x)^3*tan(c)^3 - 18*B*a^2*b*tan(d*x)^2*tan(c)^4 - 18*A*a*b^2*tan(d*x)^2*tan(c)^4 + 6*
B*b^3*tan(d*x)^2*tan(c)^4 + 12*B*a*b^2*tan(d*x)^4*tan(c) + 4*A*b^3*tan(d*x)^4*tan(c) + 36*A*a^3*log(4*(tan(c)^
2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))
*tan(d*x)^2*tan(c)^2 - 108*B*a^2*b*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^
2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^2 - 108*A*a*b^2*log(4*(tan(c)^2 + 1)/(tan(
d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^2*
tan(c)^2 + 36*B*b^3*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + ta
n(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^2 - 36*B*a^3*tan(d*x)^3*tan(c)^2 - 108*A*a^2*b*tan(d*x)^3
*tan(c)^2 + 144*B*a*b^2*tan(d*x)^3*tan(c)^2 + 48*A*b^3*tan(d*x)^3*tan(c)^2 - 36*B*a^3*tan(d*x)^2*tan(c)^3 - 10
8*A*a^2*b*tan(d*x)^2*tan(c)^3 + 144*B*a*b^2*tan(d*x)^2*tan(c)^3 + 48*A*b^3*tan(d*x)^2*tan(c)^3 + 12*B*a*b^2*ta
n(d*x)*tan(c)^4 + 4*A*b^3*tan(d*x)*tan(c)^4 - 3*B*b^3*tan(d*x)^4 - 48*B*a^3*d*x*tan(d*x)*tan(c) - 144*A*a^2*b*
d*x*tan(d*x)*tan(c) + 144*B*a*b^2*d*x*tan(d*x)*tan(c) + 48*A*b^3*d*x*tan(d*x)*tan(c) + 36*B*a^2*b*tan(d*x)^3*t
an(c) + 36*A*a*b^2*tan(d*x)^3*tan(c) - 24*B*b^3*tan(d*x)^3*tan(c) - 36*B*a^2*b*tan(d*x)^2*tan(c)^2 - 36*A*a*b^
2*tan(d*x)^2*tan(c)^2 + 12*B*b^3*tan(d*x)^2*tan(c)^2 + 36*B*a^2*b*tan(d*x)*tan(c)^3 + 36*A*a*b^2*tan(d*x)*tan(
c)^3 - 24*B*b^3*tan(d*x)*tan(c)^3 - 3*B*b^3*tan(c)^4 - 12*B*a*b^2*tan(d*x)^3 - 4*A*b^3*tan(d*x)^3 - 24*A*a^3*l
og(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)
*tan(c) + 1))*tan(d*x)*tan(c) + 72*B*a^2*b*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + t
an(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)*tan(c) + 72*A*a*b^2*log(4*(tan(c)^2 + 1)/(t
an(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)
*tan(c) - 24*B*b^3*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan
(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)*tan(c) + 36*B*a^3*tan(d*x)^2*tan(c) + 108*A*a^2*b*tan(d*x)^2*tan(c)
 - 144*B*a*b^2*tan(d*x)^2*tan(c) - 48*A*b^3*tan(d*x)^2*tan(c) + 36*B*a^3*tan(d*x)*tan(c)^2 + 108*A*a^2*b*tan(d
*x)*tan(c)^2 - 144*B*a*b^2*tan(d*x)*tan(c)^2 - 48*A*b^3*tan(d*x)*tan(c)^2 - 12*B*a*b^2*tan(c)^3 - 4*A*b^3*tan(
c)^3 + 12*B*a^3*d*x + 36*A*a^2*b*d*x - 36*B*a*b^2*d*x - 12*A*b^3*d*x - 18*B*a^2*b*tan(d*x)^2 - 18*A*a*b^2*tan(
d*x)^2 + 6*B*b^3*tan(d*x)^2 + 36*B*a^2*b*tan(d*x)*tan(c) + 36*A*a*b^2*tan(d*x)*tan(c) - 24*B*b^3*tan(d*x)*tan(
c) - 18*B*a^2*b*tan(c)^2 - 18*A*a*b^2*tan(c)^2 + 6*B*b^3*tan(c)^2 + 6*A*a^3*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*t
an(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)) - 18*B*a^2*b*log(4*
(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(
c) + 1)) - 18*A*a*b^2*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 +
tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)) + 6*B*b^3*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c)
 + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)) - 12*B*a^3*tan(d*x) - 36*A*a^2*b*tan(d*x) + 36*B
*a*b^2*tan(d*x) + 12*A*b^3*tan(d*x) - 12*B*a^3*tan(c) - 36*A*a^2*b*tan(c) + 36*B*a*b^2*tan(c) + 12*A*b^3*tan(c
) - 18*B*a^2*b - 18*A*a*b^2 + 9*B*b^3)/(d*tan(d*x)^4*tan(c)^4 - 4*d*tan(d*x)^3*tan(c)^3 + 6*d*tan(d*x)^2*tan(c
)^2 - 4*d*tan(d*x)*tan(c) + d)